package file;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Scanner;

public class Demo8 {
    public static void main(String[] args) throws IOException {
        try(InputStream inputStream = new FileInputStream("e:/test.txt")) {
            Scanner scanner = new Scanner(inputStream);
            //此时就是从test.txt中读取文件了
            String s = scanner.next();
            System.out.println(s);
        }
    }
}
